//#include "lane.h"		// EXECUTION LANES

//#include "issue_queue.h"	// ISSUE QUEUE

//////////////////////////////////////////////////////////////////////////////


class processing_element{
private:
	unsigned int issue_width;	// issue width (number of processor execution lanes)

	issue_queue IQ_INT;
	issue_queue IQ_FP;

	lane *Execution_Lanes;

	//	mem_interface *myLSU;
	//
	//	renamer *my_ren_int;
	//	renamer *my_ren_fp;

	processor *top_level;

	unsigned long long *localRegistersInt, *localRegistersFp;

	void alu(unsigned int index);
	void resolve(unsigned int branch_ID, bool correct);

	bool free;
	unsigned int my_ID;


public:

	processing_element(unsigned int iq_size, unsigned int issue_width, processor &top, unsigned int ID);

	void schedule();
	void register_read(unsigned int lane_number);
	void execute(unsigned int lane_number);
	void writeback(unsigned int lane_number);

	unsigned long long read(unsigned int local_reg);
	void write(unsigned int local_reg, unsigned long long value);

	bool is_free();
	void set_free();
	void clear_free();
	void wakeup_int(unsigned int phys_reg);
	void wakeup_fp(unsigned int phys_reg);

}processing_element_t;
